<%
################################################################################
# NOTE: It is STRONGLY suggested that if you wish to customize the look and feel
# of your Helpy, that you create a custom theme instead.  This will allow
# you to override any views or styles you wish to, without compromising your
# ability to upgrade in the future
################################################################################
%>

<% post = qna.posts.by_votes.first %>

  <div id="post-<%= post.id %>" class="media post-container kind-first<%= " inactive" unless post.active? %>">
    <div class="asked-question">
      <%= distance_of_time_in_words(Time.now,qna.created_at) %> ago <%= post_message(qna.posts.first) %>
    </div>
    <h4 class="qna"><%= link_to h(qna.name), topic_posts_path(qna) -%></h4>
    <div class="pull-left">
      <%= avatar_image(post.user, size=40) %>
  	</div>
  	<div class="media-body media-right">
  		<span class="hidden-sm hidden-md hidden-lg"><%= last_active_time(post.created_at) %><br/></span>
  		<span id="row-<%= post.id %>"  class="post-menu post-menu-<%= post.id %> btn-group">
        <%= post_message(post) %>
  		</span>

  		<div id="post-body-<%= post.id %>" class="post-body less-important text-left">
  			<span class="shorten"><%= simple_format(post.body) -%></span>
        <% if post.topic.forum.allow_post_voting == true %>
  			<div id="post-vote-<%= post.id %>" class="btn btn-default">
  				<% if post.kind == 'first' %>
  				<%= link_to t(:upvote, count: post.topic.points), up_vote_path(post.topic.id), method: :post, remote: true, class: 'topic-vote', data: {voted: post.topic.to_param}, id: "upvote_#{post.topic.id}" %>
  				<% else %>
  				<%= link_to t(:upvote, count: post.points), post_vote_path(post.id), method: :post, remote: true, class: 'post-vote', data: {voted: post.topic.to_param}, id: "upvote_#{post.topic.id}" %>
  				<% end %>
  			</div>
  			<% end %>

  		</div>



  	</div>
  </div>

<hr/>
